package com.yb.socket

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import androidx.databinding.DataBindingUtil
import com.yb.socket.databinding.ActivityMainBinding
import com.yb.socket.udp.UDPFragment

class MainActivity : AppCompatActivity() {

    lateinit var binding: ActivityMainBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        binding = DataBindingUtil.setContentView(this, R.layout.activity_main)
        val transaction = supportFragmentManager.beginTransaction();

        binding.btnUdp.setOnClickListener {
            binding.linear.visibility = View.GONE
            transaction.add(R.id.container, UDPFragment.newInstance())
            transaction.commit()
        }
    }
}